home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1999 / MacHack 1999.toast / The Hacks / OutOfContextMenus / Source / CPongGameBehavior.h < prev    next >
Encoding:
Text File  |  1999-06-25  |  1.3 KB  |  58 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    CPongGameBehavior.h                 ©1999 Eric Traut
  3. // ===========================================================================
  4.  
  5. #pragma once
  6.  
  7. #include "COffscreenBehavior.h"
  8.  
  9.  
  10. typedef UInt16    PongGameState;
  11. enum
  12. {
  13.     kPongGameStartState,
  14.     kPongGameStatePlaying,
  15.     kPongGameStateTearDown
  16. };
  17.  
  18. class CPongGameBehavior : public COffscreenBehavior
  19. {
  20.     public:
  21.         CPongGameBehavior(CShadowWindow &        inShadowWindow);
  22.  
  23.         virtual Boolean
  24.         RenderToGWorld(        StGWorldLocker &        inBackingLocker,
  25.                             StGWorldLocker &        inRenderingLocker);
  26.  
  27.         virtual void
  28.         DoIdleTask(    Boolean     inGNETime);
  29.  
  30.         virtual void
  31.         HandleEvent(    EventRecord *        ioEvent, 
  32.                         Boolean *            ioResult);
  33.  
  34.         static void
  35.         Initialize(    SndChannelPtr    inSoundChannel);
  36.         
  37.     private:
  38.         PongGameState                mCurGameState;
  39.         Point                        mBallLoc;
  40.         Point                        mBallVector;
  41.         SInt16                        mLeftPaddleVHeight;
  42.         SInt16                        mRightPaddleVHeight;
  43.         UInt32                        mLastUpdateTicks;
  44.         Boolean                        mColliding;
  45.         SInt16                        mLeftPaddleVDelta;
  46.         SInt16                        mRightPaddleVDelta;
  47.         
  48.         static PicHandle            sLeftPaddlePICT;
  49.         static PicHandle            sRightPaddlePICT;
  50.         static CIconHandle            sBallIcon;
  51.         static SndChannelPtr        sSoundChannel;
  52.         static SndListHandle        sBootBeepSound;
  53.         static SndListHandle        sBootCrashSound;
  54. };
  55.  
  56.  
  57.  
  58.